SpecialFolder Module
Used to get a FolderItem to a specific folder or directory managed by the host operating system.
Properties
None
Methods
None
result=SpecialFolder.FolderName
Part | Type | Description |
result | FolderItem | If successful, a FolderItem for the specified folder/directory. SpecialFolder returns Nil if the call is unsuccessful. |
FolderName | String constant | The requested folder or directory. See the table in the Notes section for the possible values. |
Notes
Not all types of folders are supported on all operating systems. After a call to SpecialFolder, check that the result not Nil.
Here is the list of possible values for FolderName and what is returned on each platform. If the path includes the name of the current user, the word "user" appears in italics.
FolderName | Windows XP | Mac OS X | Linux |
AppleMenu | \user\StartMenu\Programs\ | Nil | Nil |
Applications | \Program Files\ | :Applications: | Nil |
ApplicationSupport | \user\Application Data\ | :Library:Application Support: | Nil |
Bin | Nil | :bin: | /bin |
ControlPanels | Nil | Nil | Nil |
Cookies | \user\Cookies\ | Nil | Nil |
Desktop | \user\Desktop\ | :Users:user:Desktop: | Nil |
Documents | \user\My Documents\ | Users:user:Document: | Nil |
Etc | Nil | :private:etc: | /etc/ |
Extensions | \Windows\System32\ | Nil | Nil |
Favorites | \user\Favorites\ | Users:user:Library:Favorites: | Nil |
Fonts | \WindowsFonts\ | :System:Library:Fonts: | Nil |
GetFromCode (string) | Pass a four-character code in String for a specific FolderItem. | ||
History | \user\Local Settings.History\ | Users:user:Sites: | Nil |
Home | Nil | :Users: | /home/ |
InternetCache | \user\Local Settings\Temporary Internet Files\ | :Library:Caches: | Nil |
Library | Nil | :Library: | /lib/ |
Mount | Nil | :Volumes: | /mnt/ |
Music | \user\My Documents\My Music\ | :Users:user:Music: | Nil |
NetworkPlaces | \user\NetHood\ | Nil | Nil |
Pictures | \user\My Documents\My Pictures\ | :Users:user:Pictures: | Nil |
Preferences | \user\Application Data\ | :Users:user:Library:Preferences: | Nil |
Printers | \user\PrintHood\ | :System:Library:Printers: | Nil |
RecentItems | \user\Recent\ | :Users:user:Library:Recent Documents: | Nil |
SBin | Nil | :sbin: | /sbin/ |
SharedApplicationData | \All Users\Application Data\ | Nil | Nil |
SharedApplications | \Program Files\Common Files\ | Nil | Nil |
SharedDesktop | \All Users\Desktop\ | Nil | Nil |
SharedDocuments | \All Users\Documents\ | :Users:Shared: | Nil |
SharedFavorites | All Users.Favorites\ | Nil | Nil |
SharedStartupItems | \Start Menu\Programs\Startup\ | Nil | Nil |
SharedTemplates | \All Users\Templates\ | Nil | Nil |
ShutdownItems | Nil | Nil | Nil |
StartupItems | \user\Start Menu\Programs\Startup\ | Nil | Nil |
System | \Windows\System32\ | :System: | Nil |
Templates | \user\Templates\ | Nil | Nil |
Temporary | \user\Local Setings\Temp\ | :private:tmp:501: TemporaryItems: | Nil |
Trash | \user\Desktop\Recycle Bin\ | :Users:user:.Trash | Nil |
UserBin | Nil | :usr:bin: | /usr/bin/ |
UserHome | Nil | :Users:user: | /home/user/ |
UserLibrary | Nil | Nil | /usr/lib/ |
UserSBin | Nil | :usr:sbin: | /usr/sbin/ |
Var | Nil | :private:var: | /var/ |
VarLog | Nil | :private:var:log: | /var/log/ |
Windows | \Windows\ | Nil | Nil |
Example
The following code gets a FolderItem for the Application Support folder and displays its absolute path.
Dim f as FolderItem
f=SpecialFolder .ApplicationSupport
If f <> Nil then
MsgBox f.Absolutepath
Else
MsgBox "There is no Application Support folder on this computer"
End if
f=SpecialFolder .ApplicationSupport
If f <> Nil then
MsgBox f.Absolutepath
Else
MsgBox "There is no Application Support folder on this computer"
End if
See Also
FolderItem class.